home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / app / gimplist.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-18  |  2.3 KB  |  81 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. #ifndef __GIMP_LIST_H__
  20. #define __GIMP_LIST_H__
  21.  
  22.  
  23. #include "gimpobject.h"
  24.  
  25. /* GimpList - a typed list of objects with signals for adding and
  26.  * removing of stuff. If it is weak, destroyed objects get removed
  27.  * automatically. If it is not, it refs them so they won't be freed
  28.  * till they are removed. (Though they can be destroyed, of course)
  29.  */
  30.  
  31.  
  32. #define GIMP_TYPE_LIST         gimp_list_get_type ()
  33. #define GIMP_LIST(obj)         GTK_CHECK_CAST (obj, GIMP_TYPE_LIST, GimpList)
  34. #define GIMP_IS_LIST(obj)      GTK_CHECK_TYPE (obj, gimp_list_get_type())
  35. #define GIMP_LIST_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_list_get_type(), GimpListClass)
  36.  
  37. struct _GimpList
  38. {
  39.   GimpObject gobject;
  40.   GtkType type;
  41.   GSList* list;
  42.   gboolean weak;
  43. };
  44.  
  45. struct _GimpListClass
  46. {
  47.   GimpObjectClass parent_class;
  48.   void (* add)    (GimpList *list, void *data);
  49.   void (* remove) (GimpList *list, void *data);
  50. };
  51.  
  52. typedef struct _GimpListClass GimpListClass;
  53.  
  54.  
  55.      
  56. /* Signals:
  57.    add
  58.    remove
  59. */
  60.  
  61.  
  62. GtkType    gimp_list_get_type (void);
  63.  
  64. GimpList * gimp_list_new      (GtkType   type,
  65.                    gboolean  weak);
  66.  
  67. GtkType    gimp_list_type     (GimpList *list);
  68. gboolean   gimp_list_add      (GimpList *list,
  69.                    gpointer  object);
  70. gboolean   gimp_list_remove   (GimpList *list,
  71.                    gpointer  object);
  72. gboolean   gimp_list_have     (GimpList *list,
  73.                    gpointer  object);
  74. void       gimp_list_foreach  (GimpList *list,
  75.                    GFunc     func,
  76.                    gpointer  user_data);
  77. gint       gimp_list_size     (GimpList *list);
  78.  
  79.  
  80. #endif  /* __GIMP_LIST_H__ */
  81.